const http = require('http')
const fs = require('fs')
const server = http.createServer()

server.on("request",(request,response) =>{
  const result = fs.readFileSync('./test.txt')

  response.setHeader('Content-Type','text/plain;charset=utf-8')
  response.end(result) 

})

server.listen(4080,"127.0.0.1",() => {
  console.log('服务启动成功')
})